package com.project.dao.activityuser;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.dtyunxi.util.DateUtil;
import com.project.dao.BaseDao;
import com.project.entity.activity.ActivityUser;
import com.project.entity.enumcommon.AuditStatusEnum;

@Repository
public class ActivityUserDao extends BaseDao<ActivityUser> {
	
	public List<Map<String,Object>> getActivityUserListByTomorrowBegin() {
		String sql = "SELECT au.id,au.mobile,au.name AS username,DATE_FORMAT(a.activity_start_date,'%Y-%m-%d %H:%i') AS activityStartDate,"
				+ " a.name AS activityName,a.address,a.province,a.city,a.district"
				+ " FROM b_activity_user au INNER JOIN b_activity a ON a.id = au.activity_id"
				+ " WHERE au.audit_status = '"+AuditStatusEnum.P+"'"
				+ " AND DATE_FORMAT(a.activity_start_date,'%Y-%m-%d') = '"+DateUtil.format(DateUtil.addDay(new Date(), 1))+"'";
		return this.findListBySql(sql);
	}

}
